package zut.edu.cs.network.io;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.poi.hssf.record.PageBreakRecord.Break;

public class deleteStr {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		BufferedReader br = null;
		BufferedWriter bw = null;
		try {
			br = new BufferedReader(new FileReader("print.txt"));
			bw = new BufferedWriter(new FileWriter("print1.txt"));
			String str;
			String str1 = "";
			while((str = br.readLine())!= null) {
				str1 = str1 + str;
				Pattern r = Pattern.compile("book");
				Matcher m = r.matcher(str);
				str = m.replaceAll("");
				bw.write(str+"\n");
			}
			bw.close();
			br.close();
			
		} catch (FileNotFoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}

}
